#pragma once

#include <QDialog>
#include <qcheckbox.h>
#include <qmessagebox.h>
#include <QLineEdit>
#include <qlistwidget.h>
#include <qstandarditemmodel.h>
#include <qlistview.h>
#include <QGroupBox>
#include <QLabel>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QPushButton>
#include <QDateTime>
#include <QTimer>
#include <QModelIndex>
#include <qdebug.h>
#include <QMap>
#include <QMapIterator>
class RecordDataDlg : public QDialog
{
	Q_OBJECT

public:
	RecordDataDlg(QWidget *parent = Q_NULLPTR);
	~RecordDataDlg();

	void initUI();
	void setCurrentTopics(const QVector<QString>& topics);

signals:
	void recordRosbag(const QString& name, const QVector<QString>& topics);

public slots:
	void onOkBtnClicked();
	void updateDefaultBagname();
	void onAddTopicItem();
	void onDeleteTopicItem();
	void onRefreshTopics();
	void onTotalTopicListViewClicked(const QModelIndex& index);
	void onRecordTopicListViewClicked(const QModelIndex& index);

private:
	QListView *totalTopicListView_;
	QListView *recordTopicListView_;

	QStandardItemModel *totalTopicModel_;
	QStandardItemModel *recordTopicModel_;

	QPushButton *addBtn_;
	QPushButton *refreshBtn_;
	QPushButton *deleteBtn_;

	QLabel *bagNameLabel_;
	QLineEdit *bagNameLineEdit_;
	QPushButton *ok_;

	QString bagName_;
	QTimer *timer_;

	QVector<QString> topics_;
};
